#!/bin/sh
host=HOST
dir_name=PROJECT_DIR
host_dir=WEB_DIR
port=PORT

command='cd '$host_dir'; mkdir '$dir_name'; cd '$dir_name'; tar xzf ../'$dir_name'.tar.gz; cd ../; rm -rf '$dir_name'.tar.gz'

cd com
tar czf ../$dir_name.tar.gz *
cd ../
scp -P $port $dir_name.tar.gz root@$host:$host_dir
ssh -p $port -l root $host $command
rm -r $dir_name.tar.gz
